package cn.itcast.demo.dao;


import cn.itcast.demo.pojo.User;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;

@FeignClient(value = "user-server",fallback = UserDaoFallback.class) //声明接口调用user-server服务
public interface UserClient {

    @GetMapping("user/{id}") //调用这个服务中的这个rest接口地址
    User queryUserById(@PathVariable("id") Long id);

    //http://localhost:8081/user/5---->  json  ---->User

}
